package com.example.s02_jsp.controlle;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Date;

//@Controller 控制器
@Controller
public class HelloController {

    @RequestMapping("/hello")
    public String hello(Model m){
        m.addAttribute("time",new Date());
        m.addAttribute("message","Hello World!");

        m.addAttribute("username","张三");
        m.addAttribute("salary",5000);

        String[] brands={"华为","三星","苹果"};
        m.addAttribute("brands",brands);

        return "hello";
    }

}
